import {Base} from "../../utils/base.js"
import { Product } from "../product/product-model.js"
var product = new Product();
class Home extends Base{
  constructor() {
    super();
  } 
  //获取小程序名称
  getXcxName(callback) {
    var params = {
      url: 'config/info',
      data: {},
      type: 'post',
      sCallback: function (data) {
        callback && callback(data);
      }
    }
    this.request(params);
  }
  //banner信息
  getBannerData(callback) {
    var params = {
      url:'carousel-item/list',
      data:{'num':8,'key':'index'},
      type:'post',
      sCallback:function(data){
        callback && callback(data);
      }
    }
    this.request(params);
  }

  //文章分类名称
  getCateData(cid, callback) {
    var params = {
      url: 'article/get-cate-name',
      data: { 'cid':cid},
      type: 'post',
      sCallback: function (data) {
        callback && callback(data);
      }
    }
    this.request(params);
  }

  //广告区
  adv(param,callback) {
    var params = {
      url: 'carousel-item/list',
      data: param,
      type: 'post',
      sCallback: function (data) {
        callback && callback(data);
      }
    }
    this.request(params);
  }
  //导航
  nav(param, callback) {
    var params = {
      url: 'nav/navitems',
      data: param,
      type: 'post',
      sCallback: function (data) {
        callback && callback(data);
      }
    }
    this.request(params);
  }


};

export { Home };